import type {Response_Dto} from '@/Dto/Response/Api_Result'
import request from '@/utils/request'

export const Get_Dept=():Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_Dept',
        method:"get"
    })
}

export const Get_DepUser=(obj:{id:string;page:number;limit:number;key:string;}):Promise<Response_Dto>=>{
    return request({
            url:'api/org/Get_DepUser',
            method:"get",
            params:obj
    })
}

export const Ban_DepUser=(obj:{uid:string;isBan:number}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Ban_DepUser',
        method:'post',
        data:obj
    })
}
export const Delete_User=(obj:{uid:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Delete_User',
        method:'post',
        data:obj
    })
}
export const Update_UserDep=(obj:{uid:string;depname:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Update_UserDep',
        method:'post',
        data:obj
    })
}

export const Get_DepDuty=(obj:{uid:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_DepDuty',
        method:'get',
        params:obj
    })
}

export const Update_UserDuty=(obj:{uid:string;dutyname:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Update_UserDuty',
        method:'post',
        data:obj
    })
}

export const Get_DutyUser=(obj:{id:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_DutyUser',
        method:'get',
        params:obj
    })
}

export const Get_DeptName=(obj:{id:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_DeptName',
        method:'get',
        params:obj
    })
}

export const Add_User=(obj:{account:string;name:string;deptid:string;dutyid:string;gender:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Add_User',
        method:'post',
        data:obj
    })
}

export const Get_DeptNameLV=(obj:{id:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_DeptNameLV',
        method:'get',
        params:obj
    })
}

export const Get_AddDuty=():Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_AddDuty',
        method:'get'
        
    })
}

export const Add_Dept=(obj:{explain:string;icon:string;lv:number;DPName:string;no:number;parent:string;checkzhiwu:[]}):Promise<Response_Dto>=>{
return request({
    url:'api/org/Add_Dept',
    method:'post',
    data:obj
})
}

export const Get_CheckDuty=(obj:{id:string}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/Get_CheckDuty',
        method:'get',
        params:obj
    })
}

export const update_dept=(obj:{id:string;explain:string;icon:string;lv:number;DPName:string;no:number;checkzhiwu:[]}):Promise<Response_Dto>=>{
    return request({
        url:'api/org/update_dept',
        method:'post',
        data:obj
    })
}

